package com.zqh.userquery.controller;

import com.zqh.myfmmall.entity.Users;
import com.zqh.myfmmall.result.Result;
import com.zqh.userquery.service.UserQueryService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2022-02-18 2:15
 */
@RestController
@RequestMapping("user")
public class UserQueryController{
    @Resource
    private UserQueryService userQueryService;

    @PostMapping("query")
    public Result userQuery(@RequestBody Users user){
        return userQueryService.queryByUser(user);
    }

    @GetMapping("retrieveUserBasicInfo/{userId}")
    public Result retrieveUserBasicInfo(@PathVariable("userId") String userId){
        return userQueryService.retrieveUserInfo(userId);
    }

    @PostMapping("retrieveBatchUserBasicInfo")
    public Result retrieveBatchUserBasicInfo(@RequestBody List<String> ids){
        return userQueryService.retrieveBatchUserInfo(ids);
    }
}
